<?php
$context=stream_context_create(options: ['http'=>[
    'method'=>'POST',
    'hesder'=>'Content-type: application/x-www-form-urlencoded',
    'content'=> http_build_query([
        'xh'=>'6666',
        'name'=>'六六大顺',
        'tel'=>'152222333222',
        'pwd'=>'1q@',
        'pwd2'=>'1q@',
    ]),
    ]]);
    $users=file_get_contents(filename: 'users.txt');
//echo  $users;
$users=preg_split('@\r\n@',$users);
echo  $users[0];
foreach ($users as $user) {
    $user=preg_split('@\t@',$user);
    print_r($user);
    $context = stream_context_create(['http' => [
        'method' => 'POST',
        'hesder' => 'Content-type: application/x-www-form-urlencoded',
        'content' => http_build_query([
            'xh' => $user[0],
            'name' => $user[1],
            'tel' => '152222333222',
            'pwd' => '1q@',
            'pwd2' => '1q@',
        ]),
    ]]);
    $html=file_get_contents(filename: 'http://localhost:8080/modify.php',context:$context);
    echo $html;
    file_get_contents(filename: 'http://localhost:8080/modify.php', context: $context);
    echo "$user[0]\t$user[1]\n";
}
